package com.woniu.server.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.woniu.server.pojo.ApprovalRecord;
import com.woniu.server.service.ApprovalRecordService;
import com.woniu.server.mapper.ApprovalRecordMapper;
import org.springframework.stereotype.Service;

/**
* @author a
* @description 针对表【approval_record(审批记录表)】的数据库操作Service实现
* @createDate 2024-11-25 17:09:55
*/
@Service
public class ApprovalRecordServiceImpl extends ServiceImpl<ApprovalRecordMapper, ApprovalRecord>
    implements ApprovalRecordService{

    /**
     * 通过表code查询数据
     * @Author hht
     * @Date Create by 2024/11/26 19:39
     */
    @Override
    public ApprovalRecord queryApprovalRecordByApprovalRecordCode(String approvalRecordCode) {
        return lambdaQuery().eq(ApprovalRecord::getApprovalRecordCode,approvalRecordCode).one();
    }

    /**
     * 修改信息
     * @Author hht
     * @Date Create by 2024/11/26 19:49
     */
    @Override
    public void updateApprovalRecordInfo(ApprovalRecord approvalRecord) {
        lambdaUpdate()
                .eq(ApprovalRecord::getApprovalRecordCode,approvalRecord.getApprovalRecordCode())
                .set(ApprovalRecord::getApprovalCode, approvalRecord.getApprovalCode())
                .set(ApprovalRecord::getApprovalName, approvalRecord.getApprovalName())
                .set(ApprovalRecord::getApprovalResult, approvalRecord.getApprovalResult())
                .set(ApprovalRecord::getApprovalComments, approvalRecord.getApprovalComments())
                .update();
    }
}




